﻿using System;
using System.Configuration;
using DuLabs.Classic.Configuration;

namespace DuLabs.Classic.Logging
{
    public class LoggingSection : ConfigurationSection
    {
        [ConfigurationProperty("enabled", IsRequired = true)]
        public bool Enabled
        {
            get
            {
                return Convert.ToBoolean(this["enabled"]);
            }
        }

        [ConfigurationProperty("throwException", IsRequired = true)]
        public bool ThrowException
        {
            get
            {
                return Convert.ToBoolean(this["throwException"]);
            }
        }

        [ConfigurationProperty("logWriters")]
        public ClassElementCollection LogWriters
        {
            get
            {
                return this["logWriters"] as ClassElementCollection;
            }
        }        
    }
}
